From: Colin Walters Date: Mon, 5 Oct 2009 20:01:40 +0000 (-0400) Subject: Fix exception when showing menu for not-running app X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~10767 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=90ebcd32e37f10b365d4c02989ce18868598ed66;p=gnome-shell.git Fix exception when showing menu for not-running app Need to check windows.length before checking first window. https://bugzilla.gnome.org/show_bug.cgi?id=597466 --- diff --git a/js/ui/appIcon.js b/js/ui/appIcon.js index d7dbd7726..760971e20 100644 --- a/js/ui/appIcon.js +++ b/js/ui/appIcon.js @@ -440,7 +440,7 @@ AppIconMenu.prototype = { // Display the app windows menu items and the separator between windows // of the current desktop and other windows. let activeWorkspace = global.screen.get_active_workspace(); - let separatorShown = windows[0].get_workspace() != activeWorkspace; + let separatorShown = windows.length > 0 && windows[0].get_workspace() != activeWorkspace; for (let i = 0; i < windows.length; i++) { if (!separatorShown && windows[i].get_workspace() != activeWorkspace) {